<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CRM系统</title>
    <link rel="stylesheet" href="bs引用文件/css/bootstrap.min.css">
    <script type="text/javascript" src="bs引用文件/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="bs引用文件/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="bs引用文件/js/bootstrap-filestyle.js"></script>
    <script type="text/javascript" src="bs引用文件/js/jquery.validate.js"></script>
    <script type="text/javascript" src="bs引用文件/js/additional-methods.js"></script>
    <script type="text/javascript" src="bs引用文件/js/messages_zh.js"></script>
<style type="text/css">
    body {
        background-image: url("upload/image/882841.jpg");
        background-size:cover;
    }
    input.error{
        border-color: #aa1111;
        border-style: solid;
        border-width:2px;
    }
    label.error{
        color: red;
    }
</style>
    <!--验证注册表单2插件-->
    <script>
        $(document).ready(function() {
            $.validator.addMethod("checktel",function(value,element){
                var num=parseInt(value);
                if(num.toString().length==11){
                    return this.optional(element) || (/^1[3|4|5|8][0-9]\d{4,8}$/.test(value));
                }else{
                    return false;
                }
            },"✘请输入正确的手机号码以便骚扰");
            $("#form2").validate({
                rules:{
                    admin2:{
                        required:true,
                        rangelength:[4,8],
                        remote:{
                            url:"customer/zhuce.php",
                            type:"post",
                            dataType:"json",
                            data:{
                                 adm:function(){ return $('#admin2').val(); }
                            }
                        }
                    },
                    password2:{
                        required:true,
                        rangelength:[4,8]
                    },
                    newpassword2:{
                        required:true,
                        equalTo: "#password2"
                    },
                    tel2:{
                        required:true,
                        checktel:true,
                        remote:{
                            url:"customer/zhuce.php",
                            type:"post",
                            dataType:"json",
                            data:{
                                tel:function(){ return $('#tel2').val(); }
                            }
                        }
                    },
                    idcard2:{
                        required:true,
                        range:[110000195001010001,890000200001010001]
                    },
                    xingming2:{
                        required:true
                    },
                    QQ2:{
                        required:true
                    },
                    yzm2:{
                        required:true,
                        remote: {
                            url: "customer/zhuce.php",
                            type: "post",
                            dataType: "json",
                            data: {
                                yz: function () {
                                    return $('#yzm2').val();
                                }
                            }
                        }
                    }
                },
                messages:{
                    admin2:{
                        required:"✘帐号不能为空",
                        rangelength:"✘帐号必须是4-8位",
                        remote:"✘帐号已经存在"
                    },
                    password2:{
                        required:"✘请输入密码",
                        rangelength:"✘密码必须是4-8位"
                    },
                    newpassword2:{
                        required:"✘请再次输入密码",
                        equalTo: "✘密码不一致"
                    },
                    tel2:{
                        required:"✘电话号码不能为空",
                        remote:"✘该号码已经被注册"
                    },
                    idcard2:{
                        required:"✘身份证不能为空",
                        range:"✘请输入有效身份证"
                    },
                    yzm2:{
                        required:"✘请请输入验证码",
                        remote:"✘验证码错误"
                    }
                },
                errorPlacement:function(error,element){
                    error.appendTo(element.parent().next());
                },
                success: function(label) {
                    var div1=$("<div></div>").css({"color":"rgba(73, 58, 186, 0.78)","font-size":"150%"}).text("✔通过验证");
                    label.append(div1);
                    label.addClass("success");
                },
                submitHandler: function (form) {
                    alert("提交成功，请确认!");
                    form.submit();
                }
            });
        });
    </script>
    <!--验证注册表单2插件-->
</head>
<body>
<!--导航条-->
<nav class="navbar navbar-default" style="background-color: rgba(101, 108, 175, 0);border-color:  rgba(101, 108, 175, 0);">
  <div class="container-fluid">
    <a class="navbar-brand" href="index.php" style="color: #262626;">CRM管理系统</a>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
         <ul class="nav navbar-nav navbar-right">
             <li><a href="index.php" style="color: #262626;">客户登录</a></li>
             <li>
                 <a data-toggle="modal" data-target="#houtaiLogin"  role="button" style="color: #262626;">
                     后台管理
                 </a>
             </li>
         </ul>
    </div>
  </div>
</nav>
<!--导航条-->
<!--客户登录框1-->
<div style="position: absolute;top: 300px;left: 180px;" id="movegame">
<div class="modal-dialog" role="document">
    <div class="modal-content"  style=" background-image: url('upload/image/12115.jpg');">
        <div class="modal-header" >
              <div style="text-align: center">欢迎登录CRM系统</div>
        </div>
        <form class="form-horizontal" id="form1" method="post" action="customer/login.php">
        <div class="modal-body">
                <div class="form-group" id="form-group11">
                    <label for="admin" class="col-xs-3 control-label" style="color: #008200;font-size: 150%;">帐  号：</label>
                    <div class="col-xs-7">
                        <input type="text" class="form-control" id="admin" name="admin" placeholder="请输入帐号">
                    </div>
                </div>
                <div class="form-group" id="form-group12">
                    <label for="password" class="col-xs-3 control-label" style="color: #008200;font-size: 150%;"">密  码：</label>
                    <div class="col-xs-7">
                        <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-offset-3 col-xs-7">
                        <div class="checkbox">
                            <label>
                                <input id="check"  type="checkbox"> 保存状态
                            </label>
                        </div>
                    </div>
                </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-success" id="buttonkhdl" data-dismiss="modal">登录</button>
            <button type="button" class="btn btn-info" data-toggle="modal" data-target="#zhucekuang">注册</button>
        </div>
        </form>
    </div>
</div>
</div>
<!--客户登录框-->

<!--客户注册框2-->
<div class="modal fade" id="zhucekuang" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content" style="background-color: rgba(211, 253, 255, 0.5);">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true" id="guanbizhuce">&times;</span>
                </button>
                <div style="text-align: center;color: #0000cc; font-size: large;">请注册</div>
            </div>
            <form class="form-horizontal" id="form2" method="post" action="customer/zhuce.php">
            <div class="modal-body">
                    <div class="form-group">
                        <label for="admin2" class="col-xs-3 control-label" style="color: blue;font-size:larger;">帐  号：</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" id="admin2" name="admin2" placeholder="请输入帐号"
                                   data-toggle="tooltip" data-placement="top" title="请输入至少4位字母或数字">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="password2" class="col-xs-3 control-label" style="color: blue;font-size:larger;"">密  码：</label>
                        <div class="col-xs-6">
                            <input type="password" class="form-control" id="password2" name="password2" placeholder="请输入密码"
                                   data-toggle="tooltip" data-placement="top" title="请输入至少4位长度的密码">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="newpassword2" class="col-xs-3 control-label" style="color: blue;font-size:larger;"">确认密码：</label>
                        <div class="col-xs-6">
                            <input type="password" class="form-control" id="newpassword2" name="newpassword2" placeholder="请再次输入密码"
                                   data-toggle="tooltip" data-placement="top" title="请输入至少4位长度的密码">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="tel2" class="col-xs-3 control-label" style="color: blue;font-size:larger;"">电  话：</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" id="tel2" name="tel2" placeholder="请输入联系电话"
                                   data-toggle="tooltip" data-placement="top" title="请输入11位电话号码">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="xingming2" class="col-xs-3 control-label" style="color: blue;font-size: larger;">姓  名：</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" id="xingming2" name="xingming2" placeholder="您的姓名"
                                   data-toggle="tooltip" data-placement="top" title="请输入真实姓名">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="idcard2" class="col-xs-3 control-label" style="color: blue;font-size: larger;">身份证：</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" id="idcard2" name="idcard2" placeholder="请输入身份证号码"
                                   data-toggle="tooltip" data-placement="top" title="请输入真实身份证">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="QQ2" class="col-xs-3 control-label" style="color: blue;font-size: larger;">Q  Q：</label>
                        <div class="col-xs-6">
                            <input type="text" class="form-control" id="QQ2" name="QQ2" placeholder="请输入QQ号码"
                                   data-toggle="tooltip" data-placement="top" title="请输入常使用的QQ号码">
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                    <div class="form-group">
                        <label for="yzm2" class="col-xs-3 control-label" style="color: blue;font-size: larger;">输入验证码：</label>
                        <div class="col-xs-3">
                            <input type="text" class="form-control" id="yzm2" name="yzm2" data-toggle="tooltip" data-placement="top" title="请输入验证码">
                        </div>
                        <div class="col-xs-3">
                            <img src="" id="yzm"/>
                        </div>
                        <div class="col-xs-3"></div>
                    </div>
                   <button type="button" id="yzmAgain2" class="btn btn-danger col-xs-offset-6">点击获取验证码：</button>
            </div>
            <div class="modal-footer">
                <div style="text-align: left;" class="col-xs-6">
                   <button type="submit" class="btn btn-primary">提交</button>
                </div>
                <div style="text-align: right;" class="col-xs-6">
                   <button type="button" class="btn btn-warning" data-dismiss="modal" id="fangqizhuce">放弃</button>
                </div>
            </div>
            </form>
        </div>
    </div>
</div>
<!--客户注册框-->

<!--后台登录框3-->
<div class="modal fade" id="houtaiLogin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content"  style=" background-image: url('upload/image/12115.jpg');">
        <form class="form-horizontal" id="form3" method="post" action="houtai.php">
            <div class="modal-body">
                <div class="form-group" id="form-group21">
                    <label for="admin3" class="col-xs-3 control-label" style="color: #008200;font-size: 200%;">帐  号：</label>
                    <div class="col-xs-7">
                        <input type="text" class="form-control" id="admin3" name="admin3" placeholder="请输入帐号">
                    </div>
                </div>
                <div class="form-group" id="form-group22">
                    <label for="password3" class="col-xs-3 control-label" style="color: #008200;font-size: 200%;"">密  码：</label>
                    <div class="col-xs-7">
                        <input type="password" class="form-control" id="password3" name="password3" placeholder="请输入密码">
                    </div>
                </div>
                <button id="btnform3" type="button" class="btn btn-success col-xs-offset-3">登录</button>
            </div>
        </form>
          <div class="modal-footer">
                <button id="qxform3" type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
          </div>
    </div>
  </div>
</div>
<script>
    $("#btnform3").click(function(){
        $.post('houtai.php',$("#form3").serialize(),function(b){
            if(b=='boss'){

            }else if(b=='zhuguan'){

            }else if(b=='salesman'){
                location.href="salesman/smain.php";
            }else if(b=='employ'){
                location.href="employ/emain.php";
            }else if(b=='zhF'){
                $("#cjinputpwd1").remove();
                var div=$("<div></div>").attr("id","cjinputAdm1").addClass("alert alert-danger col-xs-offset-3 col-xs-7").css({"font-size":"70%","text-align":"center","height":"35px"}).text("帐号不存在");
                $("#form-group21").after(div);
            }else if(b=='mmF'){
                $("#cjinputAdm1").remove();
                var div=$("<div></div>").attr("id","cjinputpwd1").addClass("alert alert-danger col-xs-offset-3 col-xs-7").css({"font-size":"70%","text-align":"center","height":"35px"}).text("密码错误");
                $("#form-group22").after(div);
            }else{
                console.log('无效');
            }
        });
        $('#qxform3').click(function(){
            $("#cjinputpwd1").remove(); $("#cjinputAdm1").remove();
            $('#admin3').val('');$('#password3').val('');
        });
    });
</script>
<!--后台登录框-->

<script>
    //登录模态框移动
    $("#movegame").on('mousedown',function(e){
        var x= e.pageX-parseInt($(this).css("left"));
        var y= e.pageY-parseInt($(this).css("top"));
        $(document).on('mousemove',function(i){
            $("#movegame").offset({top: i.pageY-y,left: i.pageX-x});
        });
    });
    $(document).on('mouseup',function(){
        $(document).unbind("mousemove");
    });
</script>
<script>
    //客户登录
    $("#buttonkhdl").click(function(){
        $.post('customer/login.php',$("#form1").serialize(),function(a){
            if(a=='true'){
                location.href="customer/Cmain.php";
            }else if(a=='zhF'){
                $("#cjinputpwd1").remove();
                var div=$("<div></div>").attr("id","cjinputAdm1").addClass("alert alert-danger col-xs-offset-3 col-xs-7").css({"font-size":"70%","text-align":"center","height":"35px"}).text("帐号不存在");
                $("#form-group11").after(div);
                $("#password").val("");
            }else if(a=='mmF'){
                 $("#cjinputAdm1").remove();
                var div=$("<div></div>").attr("id","cjinputpwd1").addClass("alert alert-danger col-xs-offset-3 col-xs-7").css({"font-size":"70%","text-align":"center","height":"35px"}).text("密码错误");
                 $("#form-group12").after(div);
            }else{
                console.log('无效');
            }
        });
    });
</script>
<script>
    //<!--工具提示初始化-->
    $('[data-toggle="tooltip"]').tooltip();
</script>

<script>
    //<!--清空客户注册表单-->
    $("#guanbizhuce,#fangqizhuce").click(function(){
        $("#form2 input").val(''); $('label.error').hide(); $('input.error').css({"border-color": "rgba(4, 6, 4, 0.03)" });
        $("#yzm").attr("src"," ");
    });
</script>
<script>
    //获取验证码
    $("#yzmAgain2").click(function(){
        $.get("yanzhengma.php",function(){
            $("#yzm").attr("src","yanzhengma.php");
        });
    });
</script>
</body>
</html>